import {
  Controller,
  Get,
  Param,
  UseGuards,
  Query,
  DefaultValuePipe,
  ParseIntPipe,
  Post,
  Body,
} from '@nestjs/common';
import { StoreaddressService } from 'src/service/storeaddress.service';
import { AuthGuard } from 'src/guards/auth.guard';
import { QueryStoreaddressDto } from 'src/dto/query-storeaddress.dto';
import { CreateStoreaddressDto } from 'src/dto/create-storeaddress.dto';

@Controller('api/storeaddress')
// @UseGuards(AuthGuard)
export class StoreaddressApiController {
  constructor(private readonly storeaddressService: StoreaddressService) {}

  @Post('add')
  create(@Body() createStoreaddressDto: CreateStoreaddressDto) {
    return this.storeaddressService.create(createStoreaddressDto);
  }

  @Get()
  findAll(@Query() query: QueryStoreaddressDto) {
    return this.storeaddressService.query(query);
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.storeaddressService.findOne(+id);
  }
}
